<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    isActive: Boolean,
    text: String,
  },
});
</script>

<template>
  <view class="tab-item">
    <template v-if="isActive">
      <view class="tab-item-active">{{ text }}</view>
      <image
        class="tab-item-line"
        src="@/package/study/static/course-tab.png"
      />
    </template>
    <view class="tab-item-text" v-else>{{ text }}</view>
  </view>
</template>

<style lang="scss">
.tab-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 68rpx;

  .tab-item-text {
    padding-top: 4rpx;
    font-size: 32rpx;
    color: #333333;
    line-height: 44rpx;
  }

  .tab-item-active {
    margin-bottom: 6rpx;
    font-size: 36rpx;
    color: #2d2d2d;
    line-height: 50rpx;
    font-weight: bold;
  }

  .tab-item-line {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 80rpx;
    height: 24rpx;
    transform: translateX(-50%);
  }
}
</style>